package com.xintoucloud.pbs.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.xintoucloud.pbs.entity.PartyPayment;
import com.xintoucloud.pbs.service.PartyPaymentService;

@Controller@RequestMapping("/partypayment")
public class PartyPaymentController {
	@Autowired
	private PartyPaymentService partyPaymentService;
	
	@RequestMapping("/toSavePartyPayment")
	public String toSavePartyPayment() {
		return "SavePartyPayment";
	}
	@PostMapping("/savePartyPayment")
	public String savePartyPayment(PartyPayment partyPayment) {
		System.out.println("执行了");
		boolean result=partyPaymentService.savePartyPayment(partyPayment);
		if(result) {
			return "success";
		}else {
			return "redirect:toSavePartyPayment";
		}
		
	}
	@RequestMapping("/toform")
	public String toform() {
		return "form";
	}
	@RequestMapping("/tologin")
	public String tologin() {
		return "login";
	}
	@RequestMapping("/toindex")
	public String toindex() {
		return "index";
	}
	
}
